/**************************************************************************
 * Copyright (C) 2017-2017  Unisound
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 **************************************************************************
 *
 * Description : uni_lasr.h
 * Author      : wufangfang@unisound.com
 * Date        : 2019.09.18
 *
 **************************************************************************/
#ifndef SDK_VUI_VUI_BASIC_INC_UNI_LASR_H_
#define SDK_VUI_VUI_BASIC_INC_UNI_LASR_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "uni_types.h"

typedef enum {
  LASR_MODE_WAKEUP = 0,
  LASR_MODE_CMD,
  LASR_MODE_MAX
}engine_lasr_mode;

typedef void (*_cb_lasr_result)(uni_u32 session_id, const char* content, uni_u32 start, uni_u32 end);
typedef void (*_cb_lasr_timeout)(uni_u32 session_id);

/**
 * Usage:   Initialize LASR engine
 * Params:  cb_result:  callback when got result
 *          cb_timeout: callback when timeout
 * Return:  Result of initialize
 */
Result uni_lasr_init(_cb_lasr_result cb_result,
                         _cb_lasr_timeout cb_timeout);

/**
 * Usage:   Finalize LASR engine
 * Params:  
 * Return:  Result of finalize
 */
void uni_lasr_final(void);

/**
 * Usage:   Start LASR engine for wakeup
 * Params:  mode:   work mode of engine
 * Params:  timeout:   timeout for recognize
 * Return:  Result of start
 */
Result uni_lasr_start(uni_u32 session_id, engine_lasr_mode mode, uni_u32 timeout);

/**
 * Usage:   Stop LASR engine
 * Params:  
 * Return:  
 */
void uni_lasr_stop(void);


#ifdef __cplusplus
}
#endif
#endif

